import request from "@/utils/request";

/** 律师费用表单 */
export interface LawyerFeeForm {
  id?: number;
  isEdit?: boolean;
  busList?: any;
  newBus?: any;
  businessId?: number;
  businessName?: string;
  startPrice?: number;
  endPrice?: number;
  percentFlag?: string;
  minPercent?: number;
  maxPercent?: number;
  minFixedAmount?: number;
  maxFixedAmount?: number;
  cardinalityAmount?: number;
  createdAt?: string;
  updateAt?: string;
  amount?: string;
  busId?: number;
  minPrice?: string;
  maxPrice?: string;
}
/** 律师费用对象 */
export interface LawyerFeeVO {
  createdAt?: string;
  id: number;
  jobName: string;
  updateAt?: string;
}
class lawyerFeeAPI {
  /** 根据业务分类查询费用列表 */
  static getLawyerFee(id?: number) {
    return request<any, LawyerFeeVO[]>({
      url: `/api/lawyer/fee/getAllByBusId?busId=${id}`,
      method: "get",
      // data: params,
    });
  }
  /** 新增分段费用信息 */
  static updateLawyerFee(params: LawyerFeeForm) {
    return request({
      url: "/api/lawyer/fee",
      method: "post",
      data: params,
    });
  }
  /** 删除律师费用列表 */
  static deleteLawyerFee(id: string) {
    return request({
      url: `/api/lawyer/fee/${id}`,
      method: "delete",
      // data: params,
    });
  }
  /** 律师费计算 */
  static computingLawyerFee(params: LawyerFeeForm) {
    return request({
      url: "/api/lawyer/fee/math",
      method: "post",
      data: params,
    });
  }
}

export default lawyerFeeAPI;
